import { mergeConfig } from 'vite';
import eslint from 'vite-plugin-eslint';
import baseConfig from './vite.config.base';

export default mergeConfig(
  {
    mode: 'development',
    server: {
      // open: true,
      // fs: {
      //   strict: true,
      // },
      proxy: {
        '/api/': {
          target: 'http://123.206.102.198:9003',
          // 9000端口用于生产环境， 测试环境端口切换为9003
          // target: 'http://127.0.0.1:9000',
          changeOrigin: false,
          // rewrite(path) {
          //   console.log(path)
          //   return path
          // }
        }
      }
    },
    plugins: [
      eslint({
        cache: false,
        include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
        exclude: ['node_modules'],
      }),
    ],
  },
  baseConfig
);
